if(JSON.stringify($.cookie())=='{}'){  //本地是否有cookie
    console.log('本地无cookie');
}else{
    console.log('本地有cookie');
    var cookiename=document.cookie.split(";")[0].split("=")[0];
    for(var key in $.cookie()){
        cookiename=key;
    }
    create1();
};
async function geteachdata(eachid){
    var data = await Ajax('GET','http://39.105.192.164:9090/apitest/singlegood',`id=${eachid}`);
    console.log(JSON.parse(data).data);
    render(JSON.parse(data).data[0])
};
var content = $('#content');
window.onload = function(){
    var dataid = window.location.href.split('?')[1];
    console.log(dataid);
    geteachdata(dataid);
    
};
function render(data){
    var pic = $(`<img src=${data.pic}>`);
    var price = $(`<b>￥${data.price}元</b>`);
    var name =  $(`<span>${data.name}</span>`);
    var containd = $(`<h4></h4>`);
    containd.append(price).append(name);
    content.append(pic).append(containd);
    //console.log(data);
}